package r5.pierwszy.raz;

import java.lang.reflect.Modifier;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class ReflectionsZabawa {

	public static void main(String[] args) {

		Object m;
		try {
			m = Class.forName("java.util.Date").newInstance();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		
		m = new GregorianCalendar(2000, Calendar.DECEMBER, 31, 23, 59, 59).getTime();
		
		System.out.println(DateFormat.getDateInstance().format(m));
		
		System.out.println(Modifier.toString(m.getClass().getModifiers()));
		System.out.println(m.getClass().getSuperclass());
		System.out.println(m.getClass().getDeclaredFields());
	}

}
